//
//  SANetworking.h
//  Saas
//
//  Created by 杨荣 on 2020/3/12.
//  Copyright © 2020 bing. All rights reserved.
//

#import <Foundation/Foundation.h>
@class SASalesOrderViewListModel;

NS_ASSUME_NONNULL_BEGIN

typedef void (^NetworkingSuccessBlock)(id response);
typedef void (^NetworkingFailBlock)(NSString *errorMessage);


@interface SANetworking : NSObject

+ (instancetype)shareInstance;

/// GET请求：查询商品
/// @param attrId 属性ID,如果有就传，没有就不传
/// @param barCodeSign 条码启用标识(true 启用)
/// @param customerId 客户ID，如果有就传，没有就不传
/// @param productCodeOrBar 商品名称(款号/条码)(barCodeSign 条码启用标识(true 启用))
/// @param successBlock 成功回调
/// @param failBlock 失败回调
- (void)getRequestByFindingProductWithAttrId:(NSString *)attrId
                                 barCodeSign:(BOOL)barCodeSign
                                  customerId:(NSString *)customerId
                            productCodeOrBar:(NSString *)productCodeOrBar
                                successBlock:(NetworkingSuccessBlock)successBlock
                                   failBlock:(NetworkingFailBlock)failBlock;
/// GET请求：查询商品分类（类别、品牌、季节）
/// @param successBlock 成功回调
/// @param failBlock 失败回调
- (void)getRequestByGetProductTypeWithSuccessBlock:(NetworkingSuccessBlock)successBlock
                                         failBlock:(NetworkingFailBlock)failBlock;

/// POST请求：新增/编辑盘点
/// @param stockCheckFlowId 盘点流水
/// @param productSkuForms 盘点数据
/// @param remark 备注
/// @param totalBeforeStock 库存合计
/// @param totalAfterStock 盘点数合计
/// @param successBlock 成功毁掉
/// @param failBlock 失败回调
- (void)postRequestByUpdateCheckWithStockCheckFlowId:(NSString *)stockCheckFlowId
                                     productSkuForms:(NSArray <SASalesOrderViewListModel *>*)productSkuForms
                                              remark:(NSString *)remark
                                    totalBeforeStock:(NSString *)totalBeforeStock
                                     totalAfterStock:(NSString *)totalAfterStock
                                        successBlock:(NetworkingSuccessBlock)successBlock
                                           failBlock:(NetworkingFailBlock)failBlock;
/// GET请求：盘点单据列表
/// @param checkOrderNo 盘点单号
/// @param checkStatus 状态(0-未处理 1-已处理 2-已作废)
/// @param startTime 开始时间
/// @param endTime 结束时间
/// @param currentPage 当前页码，缺省默认为1
/// @param pageSize 页码大小。缺省默认10
/// @param successBlock 成功回调
/// @param failBlock 失败回调
- (void)getRequestByGetCheckBillsListWithCheckOrderNo:(NSString *)checkOrderNo
                                          checkStatus:(NSString *)checkStatus
                                            startTime:(NSString *)startTime
                                              endTime:(NSString *)endTime
                                          currentPage:(NSInteger)currentPage
                                             pageSize:(NSInteger)pageSize
                                         successBlock:(NetworkingSuccessBlock)successBlock
                                            failBlock:(NetworkingFailBlock)failBlock;
/// GET请求：盘点详情
/// @param stockCheckFlowId 流水ID
/// @param successBlock 成功回调
/// @param failBlock 失败回调
- (void)getRequestByGetCheckBillsDetailWithStockCheckFlowId:(NSString *)stockCheckFlowId
                                               successBlock:(NetworkingSuccessBlock)successBlock
                                                  failBlock:(NetworkingFailBlock)failBlock;
/// POST请求：盘点处理
/// @param stockCheckFlowIds 流水ID（多个流水号用逗号拼接成字符串）
/// @param successBlock 成功回调
/// @param failBlock 失败回调
- (void)postRequestByCheckHandleWithStockCheckFlowIds:(NSString *)stockCheckFlowIds
                                         successBlock:(NetworkingSuccessBlock)successBlock
                                            failBlock:(NetworkingFailBlock)failBlock;
/// POST请求：余款清零
/// @param stockCheckFlowIds 流水ID（多个流水号用逗号拼接成字符串）
/// @param successBlock 成功回调
/// @param failBlock 失败回调
- (void)postRequestByCheckClearZeroWithStockCheckFlowIds:(NSString *)stockCheckFlowIds
                                            successBlock:(NetworkingSuccessBlock)successBlock
                                               failBlock:(NetworkingFailBlock)failBlock;
/// POST请求：作废盘点单
/// @param stockCheckFlowId 流水ID
/// @param successBlock 成功回调
/// @param failBlock 失败回调
- (void)postRequestByCheckCancelWithStockCheckFlowId:(NSString *)stockCheckFlowId
                                        successBlock:(NetworkingSuccessBlock)successBlock
                                           failBlock:(NetworkingFailBlock)failBlock;
/// GET请求：盈亏表列表
/// @param startTime 开始时间
/// @param endTime 结束时间
/// @param currentPage 当前页码，缺省默认为1
/// @param pageSize 页码大小。缺省默认10
/// @param successBlock 成功回调
/// @param failBlock 失败回调
- (void)getRequestByGetProfitLossListWithStartTime:(NSString *)startTime
                                           endTime:(NSString *)endTime
                                       currentPage:(NSInteger)currentPage
                                          pageSize:(NSInteger)pageSize
                                      successBlock:(NetworkingSuccessBlock)successBlock
                                         failBlock:(NetworkingFailBlock)failBlock;
/// GET请求：盈亏明细
/// @param checkOrderId 盘点ID(每次必传)
/// @param productNameOrCode 商品款号和名称
/// @param showDiff 是否显示盈亏,默认0 不显示 1 显示
/// @param currentPage 当前页码，缺省默认为1
/// @param pageSize 页码大小。缺省默认10
/// @param successBlock 成功回调
/// @param failBlock 失败回调
- (void)getRequestByGetProfitLossDetailWithCheckOrderId:(NSString *)checkOrderId
                                      productNameOrCode:(NSString *)productNameOrCode
                                               showDiff:(BOOL)showDiff
                                            currentPage:(NSInteger)currentPage
                                               pageSize:(NSInteger)pageSize
                                           successBlock:(NetworkingSuccessBlock)successBlock
                                              failBlock:(NetworkingFailBlock)failBlock;
/// GET请求：未盘商品列表
/// @param productNameOrCode 商品名称或款号
/// @param productCategoryId 商品类别ID
/// @param startTime 开始时间
/// @param endTime 结束时间
/// @param currentPage 当前页码，缺省默认为1
/// @param pageSize 页码大小。缺省默认10
/// @param successBlock 成功回调
/// @param failBlock 失败回调
- (void)getRequestByGetNotCheckListWithProductNameOrCode:(NSString *)productNameOrCode
                                       productCategoryId:(NSString *)productCategoryId
                                               startTime:(NSString *)startTime
                                                 endTime:(NSString *)endTime
                                             currentPage:(NSInteger)currentPage
                                                pageSize:(NSInteger)pageSize
                                            successBlock:(NetworkingSuccessBlock)successBlock
                                               failBlock:(NetworkingFailBlock)failBlock;

@end

NS_ASSUME_NONNULL_END
